﻿using DevExpress.XtraEditors;
namespace Mota.XMLControls
{
    /// <summary>
    /// Represent Panel control based on DX PanelControl 
    /// </summary>
    public class DXGuiPanel : GuiPanel
    {
        /// <summary>
        /// Create PanelControl and assign PanelControl 
        /// </summary>
        public DXGuiPanel()
        {
            visualControl = new PanelControl();
            (visualControl as PanelControl).AutoSize = true;
        }
        /// <summary>
        /// Add Child Control
        /// </summary>
        /// <param name="guiControl">child control</param>
        public override void Add(GuiControl guiControl)
        {
            base.Add(guiControl);
            (visualControl as PanelControl).Controls.Add((guiControl.visualControl as System.Windows.Forms.Control));
        }

        /// <summary>
        /// GET|SET GroupControl Text property
        /// </summary>
        public override string Text
        {
            get
            {
                return (visualControl as PanelControl).Text;
            }
            set
            {
                (visualControl as PanelControl).Text = value;
            }
        }
        /// <summary>
        /// Dummy object
        /// </summary>
        public override object Binding
        {
            get
            {
                return null;
            }
            set
            {
                //throw new System.NotImplementedException();
            }
        }
        /// <summary>
        /// Dummy method
        /// </summary>
        /// <param name="valueBinding"></param>
        public override void SetValue(object valueBinding)
        {
            throw new System.NotImplementedException();
        }

        public override object GetValue()
        {
            throw new System.NotImplementedException("Panel dont have value");
        }
    }
}
